bin/commit: add --keep-metadata option
authorJonathan Lebon <jlebon@redhat.com>
Tue, 9 Jan 2018 20:29:22 +0000 (20:29 +0000)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 10 Jan 2018 01:42:56 +0000 (01:42 +0000)
commit939791b4fa528bd69d25ecb9354b0a3013c45be8
tree16fae334770238665cba4e3c507ba038fac84a01
parent95e574d09b36846e1611b5e89e1caf068b2468c3
bin/commit: add --keep-metadata option

Clients of libostree such as rpm-ostree make extensive use of the
`ostree commit -b foo --tree=ref=foo` pattern in their tests, e.g. to
simulate an update.

What I'm trying to solve here is that it's often the case that we want
to keep metadata from the previous commit without having to be too
verbose (i.e. reading from the parent, then passing it as an argument).

The new `--keep-metadata` switch makes this really easy. I intend to use
this in the rpm-ostree testsuite to make sure we always carry over the
`source-title` metadata as well as during set up for tests that require
`rpmostree.rpmdb.pkglist` metadata.

I initially implemented this in a small wrapper script that uses the API
directly, though we make use of so many other `ostree commit` functions
that it'd require re-implementing a lot of it.

Closes: #1402
Approved by: cgwalters
bash/ostree
src/ostree/ot-builtin-commit.c
tests/basic-test.sh